/**
 * Created by 李科风 on 2016-05-04.
 */
define(["core", "tools"], function (core, tools) {
    function init() {
        scope = core.globalData("scope");
        $.get("/system/config/getFusionConfig", function (data) {
            scope.fusion = data;
            scope.$apply();
        })

        scope.saveFusion = function () {
            $('#fusionCfg').validator();
            if ($("#saveFusion").hasClass("disabled")) {
                return;
            }
            $.post("/system/config/saveFusionConfig", scope.fusion, function () {
                tools.notifyMini({message: '保存成功'});
            })
        }
    }

    var service = {init: init};
    return service;
})